*******************************************
*        Wartime Elections: 2004          *
* Logitudinal Analysis of Bush's Approval *
*     Full Series (1/2001 - 11/2005)      *
*******************************************


calendar 2001 1 12
allocate 2005:11
open data bush_app_4.txt
data(format=free,org=obs) / overall iraqdcom2 iraqcas wotcas logicas logwot icasmean icasmin $
 logimean logimin wotmean wotmin logwmean logwmin ics sept11t iraqt


*** Source Files

source bjident.src
source info.src
source rgser.src
source dfunit.src
source kpss.src
source vratio.src
source fif.src
source arf500.src


*** Differencing

diff overall / overalld
diff iraqdcom2 / iraqdcom2d
diff iraqcas / iraqcasd
diff wotcas / wotcasd
diff logicas / logicasd
diff logwot / logwotd
diff icasmean / icasmeand
diff icasmin / icasmind
diff logimean / logimeand
diff logimin / logimind
diff wotmean / wotmeand
diff wotmin / wotmind
diff logwmean / logwmeand
diff logwmin / logwmind
diff ics / icsd
diff sept11t / sept11td
diff iraqt / iraqtd


*** Interactions

set wiraqcas = iraqdcom2 * iraqcas
set wwotcas = iraqdcom2 * wotcas
set wlogicas = iraqdcom2 * logicas
set wlogwot = iraqdcom2 * wlogwot
set wicasmean = iraqdcom2 * icasmean
set wicasmin = iraqdcom2 * icasmin
set wlogimean = iraqdcom2 * logimean
set wlogimin = iraqdcom2 * logimin
set wwotmean = iraqdcom2 * wotmean
set wwotmin = iraqdcom2 * wotmin
set wlogwmean = iraqdcom2 * logwmean
set wlogwmin = iraqdcom2 * logwmin

set wiraqcasd = iraqdcom2d * iraqcasd
set wiraqcas2 = iraqdcom2d * iraqcas

print / sept11t


*** Unit Root Tests

@dfunit(ttest) overall
@dfunit(ttest) iraqdcom2
@dfunit(ttest) iraqcas
@dfunit(ttest) wotcas
@dfunit(ttest) logicas
@dfunit(ttest) logwot
@dfunit(ttest) icasmean
@dfunit(ttest) icasmin
@dfunit(ttest) logimean
@dfunit(ttest) logimin
@dfunit(ttest) wotmean
@dfunit(ttest) wotmin
@dfunit(ttest) logwmean
@dfunit(ttest) logwmin
@dfunit(ttest) ics
@dfunit(ttest) sept11t
@dfunit(ttest) iraqt


*** Fractional Integration

** Add Later

set wiraqcas3 = wiraqcas/100
*** Models

smpl 2003:03 2005:11
smpl
boxjenk(ar=2,iterations=1000,inputs=5,constant) overall / levres1
# sept11t 1 1 0
# iraqt 0 1 1
# iraqcas 0 0 0
# wiraqcas3 0 0 0
# ics 0 0 0
@bjident levres1
@info








